## CC=/opt/freescale/usr/local/gcc-4.4.4-glibc-2.11.1-multilib-1.0/arm-fsl-linux-gnueabi/bin/arm-none-linux-gnueabi-gcc-4.4.4
CC=/home/G++/bin/arm-none-linux-gnueabi-gcc

export ARCH_CPU=arm
CROSS_COMPILE=/opt/freescale/usr/local/gcc-4.4.4-glibc-2.11.1-multilib-1.0/arm-fsl-linux-gnueabi/bin/arm-none-linux-gnueabi-
CROSS_COMPILE=/home/G++/bin/arm-none-linux-gnueabi-

LINUXPATH=/home/linux

EXTRA_CFLAGS += -I$(LINUXPATH)/ -I$(LINUXPATH)/drivers/mxc  

CURDIR=$(PWD)/
obj-m += mxdriver.o  

mxdriver-objs := imxdriver.o  spi_slave.o

all: mymodule  
	
##usbcontrol.out : usbcontrol.o
##	$(CC) -g  -pthread  -o $@ $^

mx51test.out : main.o clilib.o clilibapi.o
	$(CC) -g  -pthread  -o $@ $^
	cp $@ /home/rootfs/

mymodule :	
	make -C $(LINUXPATH) M=$(CURDIR)  CROSS_COMPILE=${CROSS_COMPILE} ARCH=arm   modules	
	cp mxdriver.ko /home/rootfs/
	
	
	
	
clean :
	 rm *.o
	 rm *.out
	 rm *.ko
	 rm Module.*
	 
	
